package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiSrtpRouteElementsMapper;
import com.ruoyi.net.domain.BusiSrtpRouteElements;
import com.ruoyi.net.service.IBusiSrtpRouteElementsService;

/**
 * srtp路由图网元（顺序）Service业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class BusiSrtpRouteElementsServiceImpl implements IBusiSrtpRouteElementsService 
{
    @Autowired
    private BusiSrtpRouteElementsMapper busiSrtpRouteElementsMapper;

    /**
     * 查询srtp路由图网元（顺序）
     * 
     * @param id srtp路由图网元（顺序）主键
     * @return srtp路由图网元（顺序）
     */
    @Override
    public BusiSrtpRouteElements selectBusiSrtpRouteElementsById(String id)
    {
        return busiSrtpRouteElementsMapper.selectBusiSrtpRouteElementsById(id);
    }

    /**
     * 查询srtp路由图网元（顺序）列表
     * 
     * @param busiSrtpRouteElements srtp路由图网元（顺序）
     * @return srtp路由图网元（顺序）
     */
    @Override
    public List<BusiSrtpRouteElements> selectBusiSrtpRouteElementsList(BusiSrtpRouteElements busiSrtpRouteElements)
    {
        return busiSrtpRouteElementsMapper.selectBusiSrtpRouteElementsList(busiSrtpRouteElements);
    }

    /**
     * 新增srtp路由图网元（顺序）
     * 
     * @param busiSrtpRouteElements srtp路由图网元（顺序）
     * @return 结果
     */
    @Override
    public int insertBusiSrtpRouteElements(BusiSrtpRouteElements busiSrtpRouteElements)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiSrtpRouteElements.getId())) {
            busiSrtpRouteElements.setId(uuid);
        }
        busiSrtpRouteElements.setCreateBy(SecurityUtils.getUsername());
        busiSrtpRouteElements.setCreateTime(DateUtils.getNowDate());
        busiSrtpRouteElements.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRouteElements.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteElementsMapper.insertBusiSrtpRouteElements(busiSrtpRouteElements);
    }

    /**
     * 修改srtp路由图网元（顺序）
     * 
     * @param busiSrtpRouteElements srtp路由图网元（顺序）
     * @return 结果
     */
    @Override
    public int updateBusiSrtpRouteElements(BusiSrtpRouteElements busiSrtpRouteElements)
    {
        busiSrtpRouteElements.setUpdateBy(SecurityUtils.getUsername());
        busiSrtpRouteElements.setUpdateTime(DateUtils.getNowDate());
        return busiSrtpRouteElementsMapper.updateBusiSrtpRouteElements(busiSrtpRouteElements);
    }

    /**
     * 批量删除srtp路由图网元（顺序）
     * 
     * @param ids 需要删除的srtp路由图网元（顺序）主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteElementsByIds(String[] ids)
    {
        return busiSrtpRouteElementsMapper.deleteBusiSrtpRouteElementsByIds(ids);
    }

    /**
     * 删除srtp路由图网元（顺序）信息
     * 
     * @param id srtp路由图网元（顺序）主键
     * @return 结果
     */
    @Override
    public int deleteBusiSrtpRouteElementsById(String id)
    {
        return busiSrtpRouteElementsMapper.deleteBusiSrtpRouteElementsById(id);
    }
}
